from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('bank.app.views',
    url(r'^accounts/$', 'list_accounts', name='accounts'),
    url(r'^accounts/(?P<account_id>\d+)/$', 'account_details', name='account_details'),
    url(r'^accounts/(?P<account_id>\d+)/payments/$', 'list_payments', name='list_account_payments'),
    url(r'^accounts/(?P<account_id>\d+)/payments/new/$', 'new_payment', name='account_new_payment'),
    url(r'^accounts/(?P<account_id>\d+)/payments/(?P<detail>from|to)/$', 'list_payments', name='list_account_payments_to_from'),
    url(r'^accounts/(?P<account_id>\d+)/payments/(?P<payment_id>\d+)/$', 'payment_details', name='account_payment_details'),
    url(r'^accounts/(?P<account_id>\d+)/cards/$', 'list_cards', name='list_account_cards'),
    url(r'^accounts/(?P<account_id>\d+)/cards/(?P<card_id>\d+)/$', 'card_details', name='account_card_details'),
    url(r'^cards/$', 'list_cards', name='list_cards'),
    url(r'^cards/(?P<card_id>\d+)/$', 'card_details', name='card_details'),
    url(r'^payments/$', 'list_payments', name='list_payments'),
    url(r'^payments/new/$', 'new_payment', name='new_payment'),
    url(r'^payments/(?P<detail>from|to)/$', 'list_payments', name='list_payments_detail'),
    url(r'^payments/(?P<payment_id>\d+)/$', 'payment_details', name='payment_details'),
    url(r'^payments/(?P<year>\d{4})/$', 'list_payments_by_time', name="list_payments_year"),
    url(r'^payments/(?P<year>\d{4})/(?P<month>\d{1,2})/$', 'list_payments_by_time', name="list_payments_month"),
    url(r'^payments/(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/$', 'list_payments_by_time', name="list_payments_date"),
    url(r'^transfer/', 'transfer', name="transfer"),
    url(r'^cli/handle/$', 'action_dispatch', name="cli_action_handler"),
    url(r'^cli/$', 'cli_home', name="cli_home"),
    url(r'^login/$', 'app_login', name="app_login"),
    url(r'^login/(?P<login_type>[a-z]+)/$', 'app_login', name="type_app_login"),
    url(r'^logout/$', 'app_logout', name="app_logout"),
)
